package common

import (
	"time"
)

const TokenKey = "token"
const RefreshTokenKey = "refresh_token"
const ContextUserId = "user_id"

// GetUserGender 获取用户性别
func GetUserGender(gender int) string {
	switch gender {
	case 1:
		return "男"
	case 2:
		return "女"
	default:
		return "未知"
	}
}

func TrainTime(str string) string {
	// 加载时区
	loc, _ := time.LoadLocation("Asia/Shanghai")
	//填写的字符串的格式一定一定要跟给定的格式一样
	timeObj, _ := time.ParseInLocation("2006-01-02T15:04:05Z", str, loc)
	return timeObj.Format("2006-01-02 15:04:05")
}
